// compoment/common/searchBar/search.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        inputShowed: false,
        inputVal: ""
    },

    /**
     * 组件的方法列表
     */
    methods: {
        showInput: function() {
            this.setData({
                inputShowed: true
            });
        },
        hideInput: function() {
            this.setData({
                inputVal: "",
                inputShowed: false
            });
        },
        clearInput: function() {
            this.setData({
                inputVal: ""
            });
        },
        inputTyping: function(e) {
            this.setData({
                inputVal: e.detail.value
            });
        },
        searchSubmit(e){
            this.triggerEvent('doSearch', e.detail.value)
        }
    }
})